package main

type Point struct {
	X int
	Y int
}

type Player struct {
	name string
	healthPoint int
	magicPoint int
}

type Command struct {
	name string //指令名称
	Var *int //指令绑定的变量
	Comment string //指令的注释
}

func main() {
	var p Point
	p.X = 1
	p.Y = 2

	tank := new(Player)
	tank.name = "Canon"
	tank.healthPoint = 300

	var version int = 1
	cmd := &Command{}
	cmd.name = "Version"
	cmd.Var = &version
	cmd.Comment = "show verion"

	cmd = newCommand("verion", &version, "show version")
}

func newCommand(name string, varref *int, comment string) *Command  {
	return &Command{
		name:    name,
		Var:     varref,
		Comment: comment,
	}
}

